<template>
  <div class="message">
    <van-nav-bar
      @click-left="$router.back()"
      title="我的消息"
      right-text="全部已读"
      @click-right="isRead = true"
    >
      <template #left>
        <i class="iconfont icon-sdf" style="fontSize: 18px"></i>
      </template>
    </van-nav-bar>
    <van-cell-group class="txt">
      <van-cell
        title="您提交的反馈我们已经收到"
        is-link
        v-for="(item, index) in userInfo.systemMessages"
        :key="index"
      >
        <template #default>
          <div :class="{ dot: !isRead }"></div>
        </template>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data () {
    return {
      isRead: false
    }
  },
  computed: {
    ...mapState({
      userInfo: state => state.userInfo
    })
  }
}
</script>

<style lang="less" scoped>
.message {
  /deep/.van-nav-bar__text {
    color: #000;
  }
  .txt {
    padding: 10px;
    .dot {
      position: absolute;
      right: 0;
      top: 30%;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background-color: #ff4949;
    }
    /deep/.van-cell__title {
      flex: 8;
      padding-left: 5px;
    }
    /deep/.van-cell__value {
      position: relative;
      flex: 4;
    }
    .van-cell {
      padding: 10px;
      border-right: 1px solid #ff4949;
      margin-bottom: 10px;
    }
  }
}
</style>
